home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt3sp1.arc
/
GETUPLOA.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-09-26
|
6KB
|
171 lines
(*----------------------------------------------------------------------*)
(* Get_Upload_Protocol --- Get Upload File Transfer Protocol *)
(*----------------------------------------------------------------------*)
FUNCTION Get_Upload_Protocol : Transfer_Type ;
(*----------------------------------------------------------------------*)
(* *)
(* Function: Get_Upload_Protocol *)
(* *)
(* Purpose: Gets file name and transfer protocol for upload. *)
(* *)
(* Calling Sequence: *)
(* *)
(* Transtyp := Get_Upload_Protocol: Transfer_Type; *)
(* *)
(* Remarks: *)
(* *)
(* Calls: KeyPressed *)
(* Async_Send *)
(* Async_Receive *)
(* *)
(*----------------------------------------------------------------------*)
VAR
Transfer_Kind : Transfer_Type;
Transfer_Menu : Menu_Type;
I : INTEGER;
Pacing_String : STRING[1];
Ch : CHAR;
Flag : BOOLEAN;
BEGIN (* Get_Upload_Protocol *)
Get_Upload_Protocol := None;
WITH Transfer_Menu DO
BEGIN
Menu_Size := 9;
Menu_Default := ORD( Default_Transfer_Type ) + 1;
IF Menu_Default > 9 THEN Menu_Default := 1;
Menu_Row := 5;
Menu_Column := 20;
Menu_Tcolor := Menu_Text_Color;
Menu_Bcolor := BackGround_Color;
Menu_Fcolor := Menu_Frame_Color;
Menu_Width := 50;
Menu_Height := 18;
END;
FOR I := 1 TO 9 DO
WITH Transfer_Menu.Menu_Entries[I] DO
BEGIN
Menu_Item_Row := I;
Menu_Item_Column := 2;
CASE I OF
1: Menu_Item_Text := 'a) Ascii';
2: Menu_Item_Text := 'b) Xmodem (Checksum)';
3: Menu_Item_Text := 'c) Xmodem (CRC)';
4: Menu_Item_Text := 'd) Kermit';
5: Menu_Item_Text := 'e) Telink';
6: Menu_Item_Text := 'f) Modem7 (Checksum)';
7: Menu_Item_Text := 'g) Modem7 (CRC)';
8: Menu_Item_Text := 'h) Ymodem';
9: Menu_Item_Text := 'i) Ymodem (Batch)';
END (* Case *);
END;
Transfer_Menu.Menu_Title := 'Choose file transfer protocol for upload:';
Menu_Display_Choices( Transfer_Menu );
Transfer_Kind := Transfers[ Menu_Get_Choice( Transfer_Menu ,
Dont_Erase_Menu ) ];
IF ( Transfer_Kind <> Kermit ) THEN
BEGIN
GoToXY( 2 , 11 );
WRITE('Filename.Ext ? ');
READLN(FileName);
END;
IF Transfer_Kind IN [ Xmodem_Chk, Xmodem_Crc, Ascii, Ymodem ] THEN
BEGIN
ASSIGN(AFile,FileName);
(*$I- *)
RESET(AFile);
(*$I+ *)
IF Int24Result <> 0 THEN
BEGIN
Transfer_Kind := None;
WRITELN('*** File to send doesn''t exist, upload cancelled ***');
END;
END;
(* Get delays for Ascii transfers *)
Char_Delay := 0;
Line_Delay := 0;
CASE Transfer_Kind OF
Xmodem_Crc,
Xmodem_Chk,
Ymodem : (*$I-*)
CLOSE( AFile );
(*$I+*)
Ascii : BEGIN
GoToXY( 2 , 12 );
WRITE('Delay between characters (milliseconds)? ');
READLN( Char_Delay );
GoToXY( 2 , 13 );
WRITE('Delay between lines (milleseconds)? ');
READLN( Line_Delay );
GoToXY( 2 , 14 );
WRITE('Pacing character? ');
READLN( Pacing_String );
IF LENGTH( Pacing_String ) > 0 THEN
Pacing_Char := Pacing_String[1]
ELSE
Pacing_Char := CHR( NUL );
REPEAT
GoToXY( 2 , 15 );
WRITE('End each line with a) CR or b) CR+LF ');
ClrEol;
READ( Kbd , Ch );
WRITE( Ch );
Ch := UpCase( Ch );
UNTIL( Ch IN ['A','B'] );
IF Ch = 'A' THEN
CR_LF_String := CHR( CR )
ELSE
CR_LF_String := CHR( CR ) + CHR( LF );
GoToXY( 2 , 16 );
WRITE('Hit ALT-S to stop transfer.');
(*$I-*)
CLOSE( Afile );
(*$I+*)
END;
None : ;
ELSE ;
END (* CASE *);
(* Return transfer protocol type *)
Get_Upload_Protocol := Transfer_Kind;
DELAY( Two_Second_Delay );
(* Remove this window *)
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
END (* Get_Upload_Protocol *);